Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix type error for precision value #89

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

fritzmg
Copy link
Contributor

@fritzmg fritzmg commented Aug 21, 2024

Currently the following type error can occur:

ypeError: NumberFormatter::setAttribute(): Argument #2 ($value) must be of type int|float, string given in vendor/magento/framework/Currency/Data/Currency.php:171
Stack trace:
#0 vendor/magento/framework/Currency/Data/Currency.php(171): NumberFormatter->setAttribute()
#1 vendor/magento/framework/Interception/Interceptor.php(58): Magento\Framework\Currency\Data\Currency->toCurrency()
#2 vendor/magento/framework/Interception/Interceptor.php(138): Lillik\PriceDecimal\Model\Currency\Interceptor->___callParent()
#3 vendor/magento/framework/Interception/Interceptor.php(153): Lillik\PriceDecimal\Model\Currency\Interceptor->Magento\Framework\Interception\{closure}()
#4 generated/code/Lillik/PriceDecimal/Model/Currency/Interceptor.php(23): Lillik\PriceDecimal\Model\Currency\Interceptor->___callPlugins()
#5 vendor/magento/module-backend/Block/Widget/Grid/Column/Renderer/Currency.php(88): Lillik\PriceDecimal\Model\Currency\Interceptor->toCurrency()
#6 vendor/magento/module-backend/Block/Widget/Grid/Column.php(287): Magento\Backend\Block\Widget\Grid\Column\Renderer\Currency->render()
#7 vendor/magento/module-backend/view/adminhtml/templates/dashboard/grid.phtml(41): Magento\Backend\Block\Widget\Grid\Column->getRowField()
#8 vendor/magento/framework/View/TemplateEngine/Php.php(67): include('...')
#9 vendor/magento/framework/View/Element/Template.php(263): Magento\Framework\View\TemplateEngine\Php->render()
#10 vendor/magento/framework/View/Element/Template.php(293): Magento\Framework\View\Element\Template->fetchView()
#11 vendor/magento/module-backend/Block/Template.php(141): Magento\Framework\View\Element\Template->_toHtml()
#12 vendor/magento/framework/View/Element/AbstractBlock.php(1128): Magento\Backend\Block\Template->_toHtml()
#13 vendor/magento/framework/View/Element/AbstractBlock.php(1132): Magento\Framework\View\Element\AbstractBlock->Magento\Framework\View\Element\{closure}()
#14 vendor/magento/framework/View/Element/AbstractBlock.php(676): Magento\Framework\View\Element\AbstractBlock->_loadCache()
#15 vendor/magento/module-backend/Block/Dashboard/Grids.php(62): Magento\Framework\View\Element\AbstractBlock->toHtml()
#16 vendor/magento/framework/View/Element/AbstractBlock.php(288): Magento\Backend\Block\Dashboard\Grids->_prepareLayout()
#17 vendor/magento/framework/View/Layout/Generator/Block.php(149): Magento\Framework\View\Element\AbstractBlock->setLayout()
#18 vendor/magento/framework/View/Layout/GeneratorPool.php(93): Magento\Framework\View\Layout\Generator\Block->process()
#19 vendor/magento/framework/View/Layout.php(365): Magento\Framework\View\Layout\GeneratorPool->process()
#20 generated/code/Magento/Framework/View/Layout/Interceptor.php(68): Magento\Framework\View\Layout->generateElements()
#21 vendor/magento/framework/View/Layout/Builder.php(129): Magento\Framework\View\Layout\Interceptor->generateElements()
#22 vendor/magento/framework/View/Page/Builder.php(65): Magento\Framework\View\Layout\Builder->generateLayoutBlocks()
#23 vendor/magento/framework/View/Layout/Builder.php(65): Magento\Framework\View\Page\Builder->generateLayoutBlocks()
#24 vendor/magento/framework/View/Layout.php(271): Magento\Framework\View\Layout\Builder->build()
#25 vendor/magento/framework/View/Layout.php(896): Magento\Framework\View\Layout->build()
#26 generated/code/Magento/Framework/View/Layout/Interceptor.php(293): Magento\Framework\View\Layout->getBlock()
#27 vendor/magento/module-backend/Model/View/Result/Page.php(26): Magento\Framework\View\Layout\Interceptor->getBlock()
#28 generated/code/Magento/Backend/Model/View/Result/Page/Interceptor.php(23): Magento\Backend\Model\View\Result\Page->setActiveMenu()
#29 vendor/magento/module-backend/Controller/Adminhtml/Dashboard/Index.php(39): Magento\Backend\Model\View\Result\Page\Interceptor->setActiveMenu()
#30 vendor/magento/framework/Interception/Interceptor.php(58): Magento\Backend\Controller\Adminhtml\Dashboard\Index->execute()
#31 vendor/magento/framework/Interception/Interceptor.php(138): Magento\Backend\Controller\Adminhtml\Dashboard\Index\Interceptor->___callParent()
#32 vendor/magento/framework/Interception/Interceptor.php(153): Magento\Backend\Controller\Adminhtml\Dashboard\Index\Interceptor->Magento\Framework\Interception\{closure}()
#33 generated/code/Magento/Backend/Controller/Adminhtml/Dashboard/Index/Interceptor.php(23): Magento\Backend\Controller\Adminhtml\Dashboard\Index\Interceptor->___callPlugins()
#34 vendor/magento/framework/App/Action/Action.php(111): Magento\Backend\Controller\Adminhtml\Dashboard\Index\Interceptor->execute()
#35 vendor/magento/module-backend/App/AbstractAction.php(151): Magento\Framework\App\Action\Action->dispatch()
#36 vendor/magento/framework/Interception/Interceptor.php(58): Magento\Backend\App\AbstractAction->dispatch()
#37 vendor/magento/framework/Interception/Interceptor.php(138): Magento\Backend\Controller\Adminhtml\Dashboard\Index\Interceptor->___callParent()
#38 vendor/magento/module-backend/App/Action/Plugin/Authentication.php(145): Magento\Backend\Controller\Adminhtml\Dashboard\Index\Interceptor->Magento\Framework\Interception\{closure}()
#39 vendor/magento/framework/Interception/Interceptor.php(135): Magento\Backend\App\Action\Plugin\Authentication->aroundDispatch()
#40 vendor/mgtcommerce/module-mgtdevelopertoolbar/src/app/code/Mgt/DeveloperToolbar/Model/App/FrontController/ToolbarPlugin.php(62): Magento\Backend\Controller\Adminhtml\Dashboard\Index\Interceptor->Magento\Framework\Interception\{closure}()
#41 vendor/magento/framework/Interception/Interceptor.php(135): Mgt\DeveloperToolbar\Model\App\FrontController\ToolbarPlugin->aroundDispatch()
#42 vendor/magento/framework/Interception/Interceptor.php(153): Magento\Backend\Controller\Adminhtml\Dashboard\Index\Interceptor->Magento\Framework\Interception\{closure}()
#43 generated/code/Magento/Backend/Controller/Adminhtml/Dashboard/Index/Interceptor.php(32): Magento\Backend\Controller\Adminhtml\Dashboard\Index\Interceptor->___callPlugins()
#44 vendor/magento/framework/App/FrontController.php(245): Magento\Backend\Controller\Adminhtml\Dashboard\Index\Interceptor->dispatch()
#45 vendor/magento/framework/App/FrontController.php(212): Magento\Framework\App\FrontController->getActionResponse()
#46 vendor/magento/framework/App/FrontController.php(146): Magento\Framework\App\FrontController->processRequest()
#47 vendor/magento/framework/Interception/Interceptor.php(58): Magento\Framework\App\FrontController->dispatch()
#48 vendor/magento/framework/Interception/Interceptor.php(138): Magento\Framework\App\FrontController\Interceptor->___callParent()
#49 vendor/magento/framework/Interception/Interceptor.php(153): Magento\Framework\App\FrontController\Interceptor->Magento\Framework\Interception\{closure}()
#50 generated/code/Magento/Framework/App/FrontController/Interceptor.php(23): Magento\Framework\App\FrontController\Interceptor->___callPlugins()
#51 vendor/magento/framework/App/Http.php(116): Magento\Framework\App\FrontController\Interceptor->dispatch()
#52 vendor/magento/framework/Interception/Interceptor.php(58): Magento\Framework\App\Http->launch()
#53 vendor/magento/framework/Interception/Interceptor.php(138): Magento\Framework\App\Http\Interceptor->___callParent()
#54 vendor/magento/module-application-performance-monitor/Plugin/ApplicationPerformanceMonitor.php(38): Magento\Framework\App\Http\Interceptor->Magento\Framework\Interception\{closure}()
#55 vendor/magento/framework/Interception/Interceptor.php(135): Magento\ApplicationPerformanceMonitor\Plugin\ApplicationPerformanceMonitor->aroundLaunch()
#56 vendor/magento/framework/Interception/Interceptor.php(153): Magento\Framework\App\Http\Interceptor->Magento\Framework\Interception\{closure}()
#57 generated/code/Magento/Framework/App/Http/Interceptor.php(23): Magento\Framework\App\Http\Interceptor->___callPlugins()
#58 vendor/magento/framework/App/Bootstrap.php(264): Magento\Framework\App\Http\Interceptor->launch()
#59 pub/index.php(30): Magento\Framework\App\Bootstrap->run()
#60 {main}

This PR forces the precision value to an integer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant